Image processing device, image processing method, program for the same, and computer readable recording medium recorded with program

ABSTRACT

A determination target region includes a combination of a red gray image, a green gray image, and a blue gray image. A CPU part transforms a three gray value matrixes to a single first data array uniquely associated with a pixel position in the determination target region. The CPU part calculates a normalized correlation value with a single second data array transformed from a model image according to the same predetermined rule, and determines whether or not a match is found with the model image according to whether or not the normalized correlation value exceeds a predetermined threshold value.

This application claims priority from Japanese patent application2005-319747, filed on Nov. 2, 2005. The entire content of theaforementioned application is incorporated herein by reference

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing device, an imageprocessing method, a program of the same, and a computer readablerecording medium recorded with the program for specifying a region in aninput image based on a correlation value with a model image, inparticular, to calculation of the correlation value in a color image.

2. Description of the Related Art

Automation has been carried out in manufacturing premises from aviewpoint of saving energy and enhancing efficiency. Various sensortypes using light, electricity, electric wave, sound wave and the likeare used to realize automation. Among the sensor types, an imageprocessing device for performing defect determination of a product andproduction management of the product by photographing the products andhalf finished products, and processing the photographed image iseffective. A detecting function similar to the detection by vision ofhuman can be realized with the image processing device, and thus anapplication range thereof is wide.

Such an image processing device executes processes (hereinaftercollectively referred to as pattern search process) such asdetermination of whether or not a region having a predetermined color orpattern is present in an input image, detection of the number of regionspresent in the input image, and detection of a position and orientation(rotation angle) of the region present in the input image. Such apattern search process is achieved by calculating the normalizedcorrelation value of the model image acting as a reference and a regionhaving the same size as the model image out of the input image obtainedby photographing the object, as disclosed in “Image processing (ImageProcessing Standard Text book)”, Computer Graphic Arts Society, p.260,Feb. 25, 1997.

With advancement in recent information technique, a pattern searchprocess employing the color image has been realized in place of aconventional gray image (gray scale image). In the general color image,the colors are defined with gray values of “red”, “green” and “blue”based on the three primary colors of light. In other words, the grayimage is defined by a one-dimensional gray value, whereas the colorimage is defined by a three-dimensional gray value.

A method of calculating a color difference in a scalar between eachcomponent of the gray value of a reference color registered in advanceand each component of the gray value in each pixel of a target colorimage, and executing the pattern search process based on the colordifference is proposed, as disclosed in Japanese Laid-Open PatentPublication No. 7-203476.

SUMMARY OF THE INVENTION

The color difference disclosed in Japanese Laid-Open Patent PublicationNo. 7-203476 is indicated as a spatial distance from the reference colorin a color space including three axes corresponding to each of “red”,“green”, and “blue, but a direction from the reference color is nottaken into consideration since the color difference is a scalar. Thus, ahigh normalized correlation value tends to be calculated if a relativerelationship of the color distribution in a certain region of the inputimage is close to a relative relationship of the color distribution inthe model image. In other words, the normalized correlation value tendsto take a high value when the certain region in the input image is closeto an image obtained by adding an even concentration component to themodel image, since the even concentration component that has been addedis ignored in the calculation step of the normalized correlation value.By way of example, the high normalized correlation value is calculatedbetween the model image having a pattern including “black” and “green”,and the image having a pattern close to the model image and having apattern including “red” and “yellow” generated by adding an even “red”to “black” and “green”.

Therefore, the image in which the relative relationship of the colordistribution is close to that of the model image tends to be detected bymistake in the conventional pattern search process using the colordifference.

The present invention, in view of solving the above problems, aims toprovide an image processing device, an image processing method, aprogram for the same, and a computer readable recording medium recordedwith the program for specifying a region having a high correlation valuewith the model image at high precision irrespective of the relativerelationship of the color distribution in the image.

According to the present invention, the image processing device forspecifying the region in the input image based on the correlation valuewith the model image is proposed. The image processing device accordingto the present invention includes an input image acquiring means foracquiring the input image made up of a plurality of pixels defined bythree color variables in which each color is independent from eachother; a determination target region setting means for setting adetermination target region having a size equal to the model imageacquired in advance with the respect to an entire region or a partialregion of the input image acquired in the input image acquiring means; afirst data array transformation means for transforming the plurality ofpredetermined colors of the three color variables defining each pixelcontained in the determination target region set in the determinationtarget region setting means to a single first array according to apredetermined rule; and a correlation value calculating means forcalculating the correlation value between the first data arraytransformed in the first data array transformation means, and a singlesecond data array transformed from the plurality of predetermined colorvariables out of the three color variables defining each pixelconfiguring the model image according to the predetermined rule.

Preferably, the first and second data arrays are single data arraystransformed from the three color variables according the predeterminedrule.

A reference image acquiring means for acquiring a reference image forextracting the model image; a model image acquiring means for extractingan image of the region corresponding to a command from the outside fromthe reference image acquired in the reference image acquiring means, andacquiring the extracted image as the model image; and a second dataarray transformation means for transforming the three color variablesdefining each pixel configuring the model image acquired in the modelimage acquiring means to the second data array according to thepredetermined rule are preferably included.

Preferably, each of the first and second data arrays is atwo-dimensional array made up of a plurality elements arranged in amatrix form in association with the position of the pixel; and each ofthe plurality of elements includes a one-dimensional array of the threecolor variables defining the pixel associated with the element.

Preferably, each of the first and second arrays includes threetwo-dimensional arrays arranged in a matrix form with one color variableout of three color variables defining each pixel associated with theposition of the pixel in addition to each of the three color variables;and the three two-dimensional arrays are arranged in order along thesame direction and configure the single data array.

Preferably, each of the first and second data arrays includes threeone-dimensional arrays in which one color variable out of the threecolor variables defining each pixel is continuously arranged in additionto each of the three color variables; and the three one-dimensionalarrays are arranged in order in the same direction and configure thesingle data array.

Preferably, the determination target region setting means sequentiallymoves the determination target region in the region of the input image,and repeatedly executes the processes in the first data arraytransformation means and the correlation value calculating means forevery movement of the determination target region. The image processingdevice further includes a determining means for specifying thedetermination target region having a high correlation value with themodel image based on a comparison between the correlation valuecalculated for every movement of the determination target region and apredetermined threshold value, and outputting the total number ofspecified determination target region and/or each position of thespecified determination target regions when the movement of thedetermination target region is completed in the determination targetregion setting means.

More preferably, the determination target region setting meanssequentially moves the determination target region in the region of theinput image, and repeatedly executes the processes in the first dataarray transformation means and the correlation value calculating meansfor every movement of the determination target region. The imageprocessing device according to the present invention further includes adetermining means for extracting the predetermined number of correlationvalues in order from highest value out of the correlation valuescalculated for every movement of the determination target region andspecifying the determination target region corresponding to theextracted correlation value when the movement of the determinationtarget region is completed in the determination target region settingmeans, and outputting each position of the specified determinationtarget region.

The three color variables are preferably gray values of red, green, andblue; and the correlation value calculating means calculates anormalized correlation value as the correlation value.

The three color variables are preferably level values representing hue,value, chroma; and each of the first and second data arrays is a singledata array transformed from the level value of the hue and chromawithout including the level value of brightness according to thepredetermined rule.

According to the present invention, the image processing method forspecifying the region in the input image based on the correlation valuewith the model image is proposed. The image processing method accordingto the present invention includes, an input image acquiring step foracquiring the input image made up of a plurality of pixels defined bythree color variables in which each color is independent from eachother; a determination target region setting step for setting adetermination target region having a size equal to the model imageacquired in advance with the respect to an entire region or a partialregion of the input image acquired in the input image acquiring step;and a correlation value calculating step for calculating the correlationvalue between a first data array and a second data array, the pluralityof predetermined colors of the three color variables defining each pixelcontained in the determination target region set in the determinationtarget region setting step being a single first data array according tothe predetermined rule, and the plurality of predetermined colorvariables out of the three color variables defining each pixelconfiguring the model image being a single second data array accordingto the predetermined rule.

Furthermore, according to the present invention, the image processingmethod for specifying the region in the input image based on thecorrelation value with the model image is provided; the image processingmethod including the input image acquiring step for acquiring the inputimage made up of a plurality of pixels defined by three color variablesin which each color is independent from each other; the determinationtarget region setting step for setting the determination target regionhaving a size equal to the model image acquired in advance with therespect to an entire region or a partial region of the input imageacquired in the input image acquiring step; a first data arraytransformation step for transforming the plurality of predeterminedcolors of the three color variables defining each pixel contained in thedetermination target region set in the determination target regionsetting step to the single first array according to the predeterminedrule; and the correlation value calculating step for calculating thecorrelation value between the first data array transformed in the firstdata array transformation step, and the single second data arraytransformed from the plurality of predetermined color variables out ofthe three color variables defining each pixel configuring the modelimage according to the predetermined rule.

Preferably, the first and second data arrays are single data arraystransformed from the three color variables according the predeterminedrule.

A reference image acquiring step for acquiring a reference image forextracting the model image; a model image acquiring step for extractingan image of the region corresponding to a command from the outside fromthe reference image acquired in the reference image acquiring step, andacquiring the extracted image as the model image; and a second dataarray transformation step for transforming the three color variablesdefining each pixel configuring the model image acquired in the modelimage acquiring step to the second data array according to thepredetermined rule are preferably provided.

Preferably, each of the first and second data arrays is atwo-dimensional array made up of a plurality elements arranged in amatrix form in association with the position of the pixel; and each ofthe plurality of elements contains a one-dimensional array of the threecolor variables defining the pixel associated with the element.

Preferably, each of the first and second arrays includes threetwo-dimensional arrays arranged in a matrix form with one color variableout of the three color variables defining each pixel associated with theposition of the pixel with respect to each of the three color variables;and the three two-dimensional arrays are arranged in order along thesame direction and configure a single data array.

Preferably, each of the first and second data arrays includes threeone-dimensional arrays in which one color variable out of the threecolor variables defining each pixel is continuously arranged withrespect to each of the three color variables; and the threeone-dimensional arrays are arranged in order in the same direction andconfigure a single data array.

More preferably, the determination target region setting stepsequentially moves the determination target region in the region of theinput image, and repeatedly executes the processes in the first dataarray transformation step and the correlation value calculating step forevery movement of the determination target region. The image processingmethod according to the present invention further includes a determiningstep for specifying the determination target region having a highcorrelation value with the model image based on a comparison between thecorrelation value calculated for every movement of the determinationtarget region and a predetermined threshold value, and outputting thetotal number of specified determination target region and/or eachposition of the specified determination target region when the movementof the determination target region is completed in the determinationtarget region setting step.

Preferably, the determination target region setting step sequentiallymoves the determination target region in the region of the input image,and repeatedly executes the processes in the first data arraytransformation step and the correlation value calculating step for everymovement of the determination target region. The image processing methodaccording to the present invention further includes a determining stepfor extracting the predetermined number of correlation values in orderfrom highest value out of the correlation values calculated for everymovement of the determination target region and specifying thedetermination target region corresponding to the extracted correlationvalue when the movement of the determination target region is completedin the determination target region setting step, and outputting eachposition of the specified determination target region.

The three color variables are preferably gray values of red, green, andblue; and the correlation value calculating step calculates thenormalized correlation value as the correlation value.

The three color variables are preferably level values representing hue,value, chroma; and each of the first and second data arrays is a singledata array transformed from the level value of the hue and chromawithout including the level value of brightness according to thepredetermined rule.

According to the present invention, a program for specifying the regionin the input image based on the correlation value with the model imagewith respect to a computer having a function of acquiring the inputimage and the model image is provided; the image processing program forthe computer to execute the input image acquiring means for acquiringthe input image made up of a plurality of pixels defined by three colorvariables in which each color is independent from each other; thedetermination target region setting means for setting the determinationtarget region having a size equal to the model image acquired in advancewith the respect to an entire region or a partial region of the inputimage acquired in the input image acquiring means; the first data arraytransformation means for transforming the plurality of predeterminedcolors of the three color variables defining each pixel contained in thedetermination target region set in the determination target regionsetting means to a single first array according to the predeterminedrule; and the correlation value calculating means for calculating thecorrelation value between the first data array transformed in the firstdata array transformation means, and the single second data arraytransformed from the plurality of predetermined color variables out ofthe three color variables defining each pixel configuring the modelimage according to the predetermined rule.

According to the present invention, a computer readable recording mediumrecorded with the program for the computer to execute the imageprocessing method is provided.

According to the present invention, two or three predetermined colorvariables out of three color variables defining each pixel contained inthe determination target region is transformed to the single first dataarray, and the correlation value with the second data array transformedfrom two or three predetermined color variables out of the three colorvariables defining each pixel contained in the model according to thesame rule is calculated. Thus, an absolute comparison is performed fortwo or three predetermined color variables out of all three colorvariables contained in the determination target region instead of therelative comparison. Therefore, the image processing device, the imageprocessing method, the program of the same, and the computer readablerecording medium recorded with the program for specifying the regionhaving a high correlation value with the model image at high precisionirrespective of the relative relationship of the color distribution inthe image are realized.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a schematic configuration view of an image sensor deviceincluding an image processing device according to an embodiment of thepresent invention;

FIG. 2 shows a view for explaining the outline of the process forspecifying the region that matches the model image with respect to theinput image;

FIG. 3 shows a view for explaining a process of transforming the RGBinformation of each pixel contained in the determination target regionOBJ to a first data array;

FIG. 4 shows a view for explaining the calculation of a normalizedcorrelation value between the first data array and the second dataarray;

FIG. 5 shows a flow chart illustrating the process in the CPU part;

FIGS. 6A and 6B show applications of the determination process by theimage processing device according to the embodiment of the presentinvention;

FIG. 7 shows a view for explaining the transformation process to thefirst data array according to variant 1 of the embodiment of the presentinvention;

FIG. 8 shows a view for explaining the transformation process to thefirst data array according to variant 2 of the embodiment of the presentinvention;

FIG. 9 shows a view for explaining the function of acquiring the modelimage; and

FIG. 10 shows a flow chart for extracting the model image in the CPUpart.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The embodiment of the present invention will now be described in detailwith reference to the drawings. The same or corresponding components aredenoted with the same reference numerals throughout the drawings, andredundant description thereof will not be repeated.

FIG. 1 shows a schematic configuration view of an image sensor device100 including an image processing device 1 according to the embodimentof the present invention.

With reference to FIG. 1, the image sensor device 100 includes an imageprocessing device 1, an imaging section 2, and a display section 3,where the imaging section 2 images the product continuously conveyed ona manufacturing line and the like, and the image processing device 1executes the pattern search process on the imaged image, by way ofexample. The image processing device 1 then displays the process resulton the display section 3, and also outputs the process result to otherdevices (not shown).

The imaging section 2, including an imaging element such as CCD (CoupledCharged Device) or CMOS (Complementary Metal Oxide Semiconductor) sensorand a lens, images the detecting target, and outputs the imaged image tothe image processing device 1. The image imaged by the imaging section 2may be a still image or a moving image.

The display section 3 displays the process result of the imageprocessing device 1, the image imaged by the imaging section 2 and thelike to the user. The display section 3 includes a liquid crystaldisplay (LCD: Liquid Crystal Display), a plasma display, an EL (ElectroLuminescence) display and the like.

The image processing device 1 includes an imaging part interface(imaging part I/F) 7, a main storage part 8, a display processing part9, an external interface (external I/F) 10, an auxiliary storage part 5,an input part 6, a reading part 11, a bus 13, and a CPU part 4, and isrealized by a personal computer and the like.

The imaging part interface 7 is electrically connected to the imagingsection 2, and after receiving the picture signal photographed with theimaging section 2 and acquiring the color information of each pixel byperforming a predetermined signal transformation process, outputs theacquired color information to the CPU part 4 via the bus 13.Specifically, the imaging part interface 7 performs framesynchronization on the picture signal received from the imaging section2, demodulates the color information of each pixel developed andtransmitted on the time axis, and acquires the color variable(hereinafter referred to as RGB information) of red, blue, and green foreach pixel. In the embodiment of the present invention, the imaging partinterface 7 is assumed to output the gray value where red, blue andgreen of each pixel respectively has 256 tones (0 to 255), by way ofexample. This holds for the following description.

The main storage part 8 stores a program to be executed on the CPU part4, the image data imaged by the imaging section 2, the data array of themodel image stored in advance, and the image data being image processedin the CPU part 4 and the like. The main storage part 8 includessemiconductor storage element such as DRAM (Dynamic Random AccessMemory), SRAM (Static Random Access Memory) and the like.

The display processing part 9 receives the data for displaying theprocess result in the CPU part 4, the image imaged by the imagingsection 2, a screen urging the user to input, a screen showing theprocessing state of the CPU part 4 and the like; performs apredetermined signal processing, and thereafter; outputs the result tothe display section 3 as the picture signal.

The external interface 10 outputs the result of the process and the likeexecuted by the CPU part 4 to the outside. By way of example, theexternal interface 10 includes a contact point output (DO) configured byphotodiode, transistor, relay and the like and a communication meanscomplying with USB (Universal Serial Bus), RS-232C (Recommended Standard232 version C), IEEE (Institute of Electrical and Electronic Engineers)1394, SCSI (Small Computer System Interface), internet (registeredtrademark) and the like.

The auxiliary storage part 5 has a non-volatile storage region, andstores the image imaged by the imaging section 2, the model imageacquired in advance, the process result in the CPU part 4 and the like.By way of example, the auxiliary storage part 5 includes a hard discdrive (HDD) and semiconductor memory such as a flash memory card, SDmemory card, and IC memory card.

The input part 6 receives setting, instruction and the like from theuser and provides the same to the CPU part 4 via the bus 13.

The reading part 11 receives the recording medium 12 recorded with theprogram to be executed on the CPU part 4, reads the program, andprovides the same to the auxiliary storage part 5 or the main storagepart 8. The recording medium 12 merely needs to be able to hold data ina non-volatile manner, and may be a removable recording medium such asoptical disc (CD(Compact disk), DVD (Digital VersatileDisc)-ROM/RAM/R/RW, MO (Magnetic Optical Disc), MD (Mini Disc)),flexible disk, magnetic tape and the like.

The CPU part 4 receives the RGB information generated from the inputimage, which is the color image, imaged by the imaging section 2 via theimaging part interface 7, and once stores the information in the mainstorage part 8 in association with the coordinate of each pixel. The CPUpart 4 then sets a determination target region having the size equal tothe model image acquired in advance with respect to the input image, andtransforms the RGB information defining the pixel contained in thedetermination target region to a single first data array according tothe predetermined rule. Furthermore, the CPU part 4 reads a singlesecond data array transformed from the RGB information defining thepixel configuring the model image stored in the main storage part 8 orthe auxiliary storage part 5 in advance according to the predeterminedrule, and calculates the normalized correlation value with thetransformed first data array.

The CPU part 4 determines whether or not the calculated normalizedcorrelation value exceeds the predetermined threshold value, and ifexceeding the threshold value, determines that the relevant setdetermination target region matches the model image. Furthermore, theCPU part 4 stores the positional information (coordinate) of thedetermination target region determined as matching the model image inthe main storage part 8 or the auxiliary storage part 5.

Similarly, the CPU part 4 sequentially moves the determination targetregion in the region of the input image, repeatedly executes thetransformation of the first data array and the calculation of thenormalized correlation value with the second data array in eachdetermination target region, and determines whether or not eachdetermination target region matches the model image. In other words, theCPU part 4 specifies the region that matches the model image out of thedetermination target regions set in the input image, and stores thecoordinate data of the specified region.

Finally, when the movement of the determination target region in theinput image is completed, the CPU part 4 displays data such as totalnumber of regions that matches the stored model image, the coordinatesof the region that matches the model image and the like on the displaysection 3 via the display processing part 9. The CPU part 4 may outputthe data to other devices (not shown) via the external interface 10.

In another configuration, the CPU part 4 once stores the normalizedcorrelation value calculated for every movement of the determinationtarget region in the main storage part 8 or the auxiliary storage part 5in association with each determination target region, in place of theconfiguration of comparing the normalized correlation value and thepredetermined threshold value for every movement of the determinationtarget region. After the movement of the determination target region inthe input image is completed, the CPU part 4 extracts a predeterminednumber of normalized correlation value in order from the highest numberout of the stored normalized correlation values, and specifies thepredetermined number of determination target regions associated with theextracted normalized correlation value. Furthermore, the CPU part 4displays the positional information such as the coordinate and the likeof the specified determination target region on the display section 3via the display processing part 9.

The CPU part 4 receives the RGB information generated from the referenceimage for extracting the model image via the imaging part interface 7,and once stores the same in the main storage part 8 in association withthe coordinate of each pixel. The CPU part 4 then sets a mask regioncorresponding to an adjustment command of the user from the referenceimage, and transforms the RGB information defining the pixel containedin the relevant region to a single second data array according to thepredetermined rule. The CPU part 4 then stores the transformed seconddata array in the main storage part 8 or the auxiliary storage part 5.

In the embodiment of the present invention, the imaging part interface 7realizes “input image acquiring means” and “reference image acquiringmeans”, and the CPU part 4 realizes “determination target region settingmeans”, “first data transformation means”, “correlation valuecalculating means”, “determining means” and “second data transformationmeans”.

The processes in the CPU part 4 will now be described in detail.

Overall Process on Input Image

FIG. 2 shows a view for explaining the outline of the process forspecifying the region that matches the model image on the input imageIMG.

With reference to FIG. 2, the input image IMG imaged in the imagingsection 2 is assumed to be configured by a plurality of pixels PELarranged in a matrix form of (P1+1)×(P2+1) by way of example. The CPUpart 4 associates the coordinate of (0, 0) to (P1, P2) on the respectivepixel configuring the input image IMG. In FIG. 2, the coordinate of eachpixel PEL is indicated by two numerical values in the row direction andthe column direction corresponding to the upper left corner of theregion of each pixel PEL.

The CPU part 4 displays the input image IMG imaged by the imagingsection 2 on the display section 3 via the display processing part 9,and receives the setting of the search region from the user. When theuser provides the setting of the search region, the CPU part 4 definesthe search region SEARCH corresponding to the setting in associationwith the input image IMG. The search region SEARCH is indicated with thestarting coordinate START and the terminating coordinate END indicatedby the coordinate of the input image IMG. When the user does not providethe setting of the search region, the CPU part 4 assumes the entireinput image IMG as the search region SEARCH.

Subsequently, the CPU part 4 sets the determination target region OBJ inthe set search region SEARCH. The determination target region OBJ has asize (number of pixels) equal to the model image. The CPU part 4sequentially moves the determination target region OBJ in the searchregion SEARCH, and determines whether or not the image contained in thedetermination target region OBJ matches the model image for everymovement.

Finally, when determined that the image contained in the determinationtarget region OBJ matches the model image at all the positions to whichthe determination target region OBJ can move to in the search regionSEARCH, the CPU part 4 terminates the process on the relevant inputimage IMG.

Transformation Process to Single Data Array

The CPU part 4 transforms the RGB information defining the pixelcontained in the determination target region OBJ set in the input imageIMG to the single first data array according to the predetermined rule,and calculates the normalized correlation value with the single seconddata array transformed from the model image according to the samepredetermined rule.

FIG. 3 shows a view for explaining the process of transforming the RGBinformation of each pixel contained in the determination target regionOBJ to the first data array.

With reference to FIG. 3, the determination target region OBJ includes acombination of a red gray image 30R, a green gray image 30G, and a bluegray image 30B defining the red gray value, the green gray value, andthe blue gray value of each pixel. Assuming the determination targetregion OBJ is configured by 4×4 pixels, by way of example, thedetermination target region OBJ can be assumed to be made up of three 4rows×4 columns gray value matrixes. In association with the pixelposition (i, j) (0≦i, j≦3) in the determination target region OBJ, eachelement is expressed as a red gray value Rij, a green gray value Gij,and a blue gray value Bij. The CPU part 4 transforms each color grayvalue to the single first data array 40 uniquely associated with thepixel position in the determination target region OBJ.

The first data array 40 in the present embodiment is made up of aplurality of elements 42 (illustrated with frame of broken line in FIG.3) arranged in matrix form of 4 rows×4 columns in association with thepixel position (i, j) of the determination target region OBJ. Eachelement 42 is made up of a one-dimensional array of the red gray value42R, the green gray value 42G, and the blue gray value 42B defining thepixel associated therewith. Therefore, the element 42 corresponding tothe pixel position (i, j) of the determination target region OBJ is madeof a one-dimensional array of the red gray value Rij, the green grayvalue Gij, and the blue gray value Bij. As a result, the first dataarray 40 becomes the gray value matrix of 12 rows×4 columns, which is atwo-dimensional array.

The array in each element 42 is not limited thereto, and may be thearray in which the array order of the red gray value Rij, the green grayvalue Gij, and the blue gray value Bij is changed, or the array arrangedin the column direction.

Therefore, the CPU part 4 transforms the RGB information contained inthe determination target region OBJ to the first data array.Furthermore, the RGB information of each pixel contained in the modelimage is transformed to the second data array according to the same ruleas in the transformation to the first data array.

The CPU part 4 may transform the RGB information of each pixel containedin the model image to the second data array as hereinafter described, ormay receive the model image and the second data array transformed fromthe RGB information thereof from other means (not shown).

Calculation Process of Normalized Correlation Value

When acquiring the first and second data arrays transformed according tothe same rule, the CPU part 4 calculates the normalized correlationvalue with respect to each other.

FIG. 4 shows a view for explaining the calculation of the normalizedcorrelation value between the first data array 40 and the second dataarray 44.

With reference to FIG. 4, the first data array 40 and the second dataarray 44 transformed according to the above described process become atwo-dimensional array having the same size (number of rows and number ofcolumns) with respect to each other. Assuming each element (gray value)in the first data array 40 and the second data array 44 as X(n, m) andY(n, m), (1≦n≦N, 1≦m≦M) to simplify the content of the description, thenormalized correlation value C is calculated as in equation (1) with thecovariance value of the first data array 40 and the second data array 44as σXY, the variance of the first data array as σX2, and the variance ofthe second data array 44 as σY2. $\begin{matrix}{\begin{matrix}{Normalized} \\{{correlation}\quad{value}\quad C}\end{matrix} = {\frac{\sigma\quad{XY}}{\sqrt{\sigma\quad X^{2}} \times \sqrt{\sigma\quad Y^{2}}} = \frac{\begin{matrix}{{N \times M \times {\sum\limits_{n = 1}^{n = N}{\sum\limits_{m = 1}^{m = M}\left( {{X\left( {n,m} \right)} \times {Y\left( {n,m} \right)}} \right)}}} -} \\{\left( {\sum\limits_{n = 1}^{n = N}{\sum\limits_{m = 1}^{m = M}{X\left( {n,m} \right)}}} \right) \times \left( {\sum\limits_{n = 1}^{n = N}{\sum\limits_{m = 1}^{m = M}{Y\left( {n,m} \right)}}} \right)}\end{matrix}}{\begin{matrix}{\sqrt{\left\{ {{N \times M \times {\sum\limits_{n = 1}^{n = N}{\sum\limits_{m = 1}^{m = M}{X\left( {n,m} \right)}^{2}}}} - \left( {\sum\limits_{n = 1}^{n = N}{\sum\limits_{m = 1}^{m = M}{X\left( {n,m} \right)}}} \right)^{2}} \right\}} \times} \\\sqrt{\left\{ {{N \times M \times {\sum\limits_{n = 1}^{n = N}{\sum\limits_{m = 1}^{m = M}{Y\left( {n,m} \right)}^{2}}}} - \left( {\sum\limits_{n = 1}^{n = N}{\sum\limits_{m = 1}^{m = M}{Y\left( {n,m} \right)}}} \right)^{2}} \right\}}\end{matrix}}}} & (1)\end{matrix}$

With reference to equation (1), the normalized correlation value C iscalculated by the sum ΣX(n, m)of the element X(n, m) in the first dataarray 40 and the sum of squares ΣX(n, m)² of the element X(n, m); thesum ΣY(n, m) of the element Y(n, m) in the second data array 44 and thesum of squares ΣY(n, m)² of the element Y(n, m); and the product of thesum Σ(X(n, m)×Y(n, m)) of the two corresponding elements in the firstdata array 40 and the second data array 44.

The CPU part 4 acquires the sum ΣY(n, m) and the sum of squares ΣY(n,m)² in advance with respect to the second data array transformed fromthe RGB information of each pixel contained in the model image. The CPUpart 4 calculates the sum ΣX(n, m) and the sum of squares ΣX(n, m)² withrespect to the first data array 40, as well as the product of the sumΣ(X(n, m)×X(n, m)) with respect to the first data array 40 and thesecond data array 44, and calculates the normalized correlation value Cfor every setting of the determination target region OBJ.

Referring again to FIGS. 3 and 4, the CPU part 4 transforms the red grayvalue, the green gray value, and the blue gray value defining each pixelcontained in the determination target region OBJ to the first data array40 as shown in FIG. 3. Therefore, the red gray value Rij, the green grayvalue Gij, and the blue gray value Bij configuring the first data array40 are respectively transformed to the element X(n, m) in the first dataarray 40 according to equation (2) shown below.Rij=X(i×3+0,j)Gij=X(i×3+1,j)   (2)Bij=X(i×3+2,j)

On the other hand, the element X (n, m) in the first data array 40 isinverse transformed to the red gray value Rij, the green gray value Gij,and the blue gray value Bij, according to equation (3) shown below.X(n,m)=Rkm(when n=3k+0)Gkm(when n=3k+1)   (3)Bkm(when n=3k+2)

where, k=0, 1, 2, . . .

As described above, the CPU part 4 transforms the red gray value, thegreen gray value, and the blue gray value defining each pixel containedin the determination target region OBJ to the first data array so thatits correspondence relationship is uniquely defined, and inversetransformation is possible. Since the second data array 44 istransformed according to the same rule, correspondence relationship isuniquely defined for the red gray value, the green gray value, and theblue gray value defining each pixel contained in the model image andinverse transformation is possible.

Determination Process

The CPU part 4 determines whether or not the determination target regionOBJ matches the model image based on the normalized correlation value Ccalculated according to the above described process.

In equation (1), the “normalized” correlation value is calculated sincethe square root of the variance, that is, the standard deviation in thefirst data array and the second data array is contained in thedenominator. This means that the normalized correlation value C isstandardized within the range of 0≦C≦1, where C=1 when the two dataarrays are entirely the same.

A plurality of methods are known for a determining method, but in theembodiment of the invention, determination is made on whether or not thedetermination target region OBJ matches the model image according towhether the calculated normalized correlation value C exceeds apredetermined threshold value. In other words, the CPU part 4 calculatesthe normalized correlation value C of the determination target regionOBJ and the model image for every setting of the determination targetregion OBJ on the input image IMG, and compares the calculatednormalized correlation value C and the predetermined threshold value.The CPU part 4 determines that the determination target region OBJmatches the model image if the calculated normalized correlation value Cexceeds the predetermined threshold value.

In another aspect, the CPU part 4 calculates the normalized correlationvalue C between the determination target region OBJ and the model imagefor every setting of the determination target region OBJ on the inputimage IMG, and determines that a predetermined number of determinationtarget regions OBJ matches the model image from the predetermined numberfrom the high order, that is, in order from highest value out of thecalculated normalized correlation values C.

Processing Flowchart

FIG. 5 shows a flow chart illustrating the process in the CPU part 4.

With reference to FIG. 5, the CPU part 4 reads the size (number ofpixels) of the model image, the second data array, and the setting ofthe search region SEARCH etc. set in advance from the main storage part8 or the auxiliary storage part 5 (step S100). The second data arraycontains the sum and the sum of squares for the elements of the seconddata array in addition to the data array itself.

The CPU part 4 acquires the input image IMG from the imaging section 2via the imaging part interface 7 (step S102).

The CPU part 4 sets the determination target region OBJ in the searchregion SEARCH of the acquired input image IMG (step S104), and furtherextracts the RGB information defining each pixel contained in the setdetermination target region OBJ (step S106). The CPU part 4 thentransforms the extracted RGB information defining each pixel to thefirst data array (step S108). Moreover, the CPU part 4 calculates thenormalized correlation value C from the transformed first data array andthe read second data array (step S110). Specifically, the CPU part 4sequentially scans each element of the first data array, and calculatesthe normalized correlation value according to equation (1) aftercalculating the sum and the sum of squares for the elements of the firstdata array, as well as the sum of the product of each element of thefirst data array and the second data array.

Thereafter, the CPU part 4 determines whether or not the calculatednormalized correlation value C exceeds the threshold value (step S112).When the normalized correlation value C exceeds the threshold value (YESin step S112), the positional information (coordinate) of thedetermination target region OBJ being selected is stored in the mainstorage part 8 (step S114).

When the normalized correlation value C does not exceed the thresholdvalue (NO in step S112), or after the positional information of thedetermination target region OBJ being selected is stored in the mainstorage part 8 (step S114), the CPU part 4 determines whether or not allthe regions selectable in the search region SEARCH are set as thedetermination target region OBJ (step S116). When all the regions arenot selected as the determination target region OBJ (NO in step S116),the CPU part 4 sets a different region as the determination targetregion OBJ (step S118). The CPU part 4 repeatedly executes steps S106 toS114 until the determination result is YES in step S116.

When all the regions are selected as the determination target region OBJ(YES in step S116), the CPU part 4 outputs the total number and thepositional information of the determination target region OBJ in whichthe normalized correlation value C exceeds the threshold value stored inthe main storage part 8 to the display part 3 and the like (step S120).The CPU part 4 then terminates the processes.

Applications

FIG. 6 is an application of the determination process by the imageprocessing device 1 according to the embodiment of the presentinvention.

FIG. 6A shows one example of the determination target region OBJ and themodel image.

FIG. 6B shows the first and second data array transformed from the RGBinformation of the determination target region OBJ and the model imageshown in FIG. 6A.

With reference to FIG. 6A, both the model image and the image set in thedetermination target region OBJ are assumed to be made up of 4×4 pixelsby way of example. The model image has a pattern colored with two colorsof “magenta” and “cyan” of 2×4 pixels each, and the image set in thedetermination target region OBJ has the same pattern as the model imageand has two colors of “red” and “green” generated by equally removingthe “blue component” from the model image.

In other words, comparing the red concentration image 50R, the greenconcentration image 50G, and the blue concentration image 50B obtainedby decomposing the image set in the determination target region OBJ toeach color component, and the red concentration image 54R, the greenconcentration image 54G, and the blue concentration image 54B obtainedby decomposing the model image to each color component, respectively,the red concentration components 50R, 54R and the green concentrationcomponents 50G match. Furthermore, the blue concentration images 50B,54B have a concentration difference of “255” in all the pixels.

With reference to FIG. 6B, the normalized correlation value C betweenthe first data array 40 transformed from the image set in thedetermination target region OBJ and the second data array 44 transformedfrom the RGB information of the model image is calculated according toequation (1), where C=0.5. This means that the extent of matching of theimage set in the determination target region OBJ and the model image isonly 50%. Thus, the erroneous determination is reliably avoided bysetting the threshold value to about 80%.

Therefore, the image processing device according to the embodiment ofthe present invention is able to perform, with satisfactory precision,the determination on matching even with respect to the image that may beerroneously determined in the conventional method using the colordifference.

Variant 1

The data configuration of the first and second data arrays obtained bytransforming the RGB information is not limited to the above, andvarious aspects may be used.

FIG. 7 shows a view for explaining the transformation process to thefirst data array according to variant 1 of the embodiment of the presentinvention.

With reference to FIG. 7, assuming the determination target region OBJis configured by 4×4 pixels, each element is defined as the red grayvalue Rij, the green gray value Gij, and the blue gray value Bij inassociation with the pixel position (i, j) (0≦i, j≦3) in thedetermination target region OBJ, similar to FIG. 3.

The first data array 60 according to variant 1 of the embodiment of thepresent embodiment is a two-dimensional array, and is configured withthe red gray image 30R, the green gray image 30G, and the blue grayimage 30B defining the determination target region OBJ arrangedjuxtaposed in the row direction. The red gray image 30R, the green grayimage 30G, and the blue gray image 30B are respectively configured by4×4 pixels, and thus the first data array 60 has a gray value matrix of12 rows×4 columns.

Therefore, in the variant 1 of the embodiment of the present inventionas well, the RGB information defining each pixel of the determinationtarget region OBJ is transformed to a single first data array 60uniquely associated with the relevant pixel position in thedetermination target region OBJ.

The second data array transformed from the RGB information of the pixelsconfiguring the model image obviously has the same array configurationas the first data array 60 described above.

The normalized correlation value C can be calculated by similarlyapplying equation (1) on the first and second data arrays according tovariant 1 of the embodiment of the present invention, and thus thedetailed description will not be repeated.

The arrangement form of the red gray image 30R, the green gray image 30Gand the blue gray image 30B in the first data array 60 is not limitedthereto, and may take a form in which the order of arrangement ischanged or may take a form in which the gray images are arrangedjuxtaposed in the column direction.

As described above, since the data array is generated by combining thered gray image, the green gray image, and the blue gray imageconfiguring one image, transformation to the data array is facilitatedby using the picture signal from each CCD if the imaging sectionincluding three CCDs for acquiring the gray value for each color isused.

Variant 2

The configuration using the first and second data arrays oftwo-dimensional arrays have been explained in the embodiment and variant1 thereof of the present invention, but a configuration ofone-dimensional array may be adopted.

FIG. 8 shows a view for explaining the transformation process to thefirst data array 70 according to variant 2 of the embodiment of thepresent invention.

With reference to FIG. 8, assuming the determination target region OBJis configured by 4×4 pixels, each element is defined with the red grayvalue Rij, the green gray value Gij, and the blue gray value Bij, inassociation with the pixel position (i, j) (0≦i, j≦3) in thedetermination target region OBJ, similar to FIG. 3.

The first data array 70 according to variant 2 of the embodiment of thepresent invention is a one-dimensional array in which the red gray valueRij, the green gray value Gij, and the blue gray value Bij are developedin the row direction and continuously arranged for each of the red grayimage 30R, the green gray image 30G, and the blue gray image 30B. Inother words, the first data array 70 is configured with the red grayvalue array 72R, the green gray value array 72G, and the blue gray valuearray 72B juxtaposed in the same direction. The red gray value array 72Ris configured as R00, R10, . . . , R01, R11, . . . , R33 in which thered gray values Rij configuring the red gray image 30R are continuouslyarranged along the row direction. The green gray value array 72G and theblue gray value array 72B are configured similar to the red gray valuearray 72R.

Each of the red gray image 30R, the green gray image 30G, and the bluegray image 30B is configured by 4×4 pixels (16 pixels), and thus thefirst data array 70 becomes a one-dimensional array including 48 grayvalues.

Therefore, in variant 2 of the embodiment of the present invention aswell, the RGB information defining each pixel of the determinationtarget region OBJ is transformed to a single first data array 70uniquely associated with the relevant pixel position in thedetermination target region OBJ.

The second data array transformed from the RGB information of the pixelsconfiguring the model image obviously has the same array configurationsame as the first data array 70 described above.

The arrangement form of the red gray value Rij, the green gray valueGij, and the blue gray value Bij in the first data array 70 is notlimited thereto, and the red gray value Rij, the green gray value Gij,and the blue gray value Bij may be continuously arranged for each pixel.

Since the first and second data arrays according to variant 2 of theembodiment of the present invention are one-dimensional array, thenormalized correlation value C can be calculated from an equationsimpler than the equation (1). Assuming each gray value of the firstdata array according to variant 2 of the embodiment of the presentinvention is X(1) and each gray value of the second data array is Y(1)(1≦l≦L), the normalized correlation value C is calculated from equation(4). $\begin{matrix}{\begin{matrix}{Normalized} \\{{correlation}\quad{value}\quad C}\end{matrix} = \frac{{L \times {\sum\limits_{l = 1}^{l = L}\left( {{X(l)} \times {Y(l)}} \right)}} - {\sum\limits_{l = 1}^{l = L}{{X(l)} \times {\sum\limits_{l = 1}^{l = L}{Y(l)}}}}}{\begin{matrix}{\sqrt{{L \times {\sum\limits_{l = 1}^{l = L}{X(l)}^{2}}} - \left( {\sum\limits_{l = 1}^{l = L}{X(l)}} \right)^{2}} \times} \\\sqrt{{L \times {\sum\limits_{l = 1}^{l = L}{Y(l)}^{2}}} - \left( {\sum\limits_{l = 1}^{l = L}{Y(l)}} \right)^{2}}\end{matrix}}} & (4)\end{matrix}$

With reference to equation (4), equation (4) is a more simplified formto allow equation (1) to be applied to the one-dimensional array.

The calculation speed increases since the processes in the calculationprocess of the normalized correlation value are more simplified whentransforming to the one-dimensional data array, as described above.

Model Image Acquiring Process

The image processing device 1 according to the embodiment of the presentinvention further has a function of acquiring the reference image andacquiring the model image from the reference image.

FIG. 9 shows a view for explaining the function of acquiring the modelimage.

With reference to FIGS. 1 and 9, the user arranges the product sampleand the like in the photographing range of the imaging section 2, forexample, to extract the model image. When the user provides a photographstart command via the input part 6, the CPU part 4 acquires the imagefrom the imaging section 2 in response to the photograph start command,and displays the same as the reference image SIMG via the displaysection 3. Simultaneously, the CPU part 4 displays the mask region MSKfor extracting the model image from the reference image SIMG. The CPUpart 4 displays the mask region MSK of a size (default size) defined inadvance as the initial value. Furthermore, the user provides anadjustment command for the position, the size etc. of the mask regionMSK via the input part 6 so as to surround the desired image 80 withreference to the reference image SIMG displayed on the display section3. The CPU part 4 then changes the position and the size of the maskregion MSK displayed on the display section 3 in response to theadjustment command.

When the setting of the mask region MSK is completed, the user providesa determination command via the input part 6. The CPU part 4 thenacquires information of the image contained in the range of the maskregion MSK in response to the determination command. Specifically, theCPU part 4 stores the image size of the mask region MSK and the RGBinformation of each pixel contained in the range of the mask region MSKin the main storage part 8.

The CPU part 4 transforms the RGB information of each pixel stored inthe main storage part 8 to the second data array according to the samerule as the transformation to the first data array, and stores thetransformed second data array in the main storage area 8. Thetransformation to the second data array is the same as thetransformation to the first data array described above, and thus thedetailed description thereof will not be repeated. Simultaneously, theCPU part 4 calculates the sum and the sum of squares for the elements inthe second data array, and stores the same in the main storage part 8.

FIG. 10 shows a flow chart for extracting the model image in the CPUpart 4.

With reference to FIG. 10, the CPU part 4 determines whether or not thephotograph start command has been received from the outside (step 200).The user arranges the reference object for extracting the model image inthe photographing range of the imaging section 2, and provides thephotograph start command via the input part 6.

When the photograph start command is not received (NO in step 200), theCPU part 4 waits until the photograph start command is received (step200).

When the photograph start command is received, the CPU part 4 displaysthe reference image SIMG acquired from the imaging section 2 and themask region MSK on the display section 3 (step S202). The CPU part 4then changes the position and the size of the mask region MSK inresponse to the adjustment command for the mask region MSK (step S204).

Furthermore, the CPU part 4 determines whether or not the determinationcommand is received from the outside (step S206). When the determinationcommand is not received (NO in step S206), the CPU part 4 repeats stepsS204 and 206.

When the determination command is received (YES in step S206), the CPUpart 4 acquires the RGB information of each pixel contained in the rangeof the set mask region MSK (step S208). The CPU part 4 then transformsthe acquired RGB information of each pixel to the second data array(step S210), and further calculates the sum and the sum of squares forthe elements in the second data array (step S212) and stores the same inthe main storage part 8. The CPU part 4 then terminates the process.

The CPU part 4 acquires the model image from the reference image SIMG,as described above.

The configuration of acquiring the model image from the reference imageSIMG has been described in the embodiment of the present invention, buta configuration of acquiring the data, that is, the size of the modelimage, the second data array, the sum and the sum of squares for thesecond data array etc. related to the model image from other devices(not shown) may be adopted.

The configuration of determining the existence of matching using thenormalized correlation value has been described in the description forthe embodiment of the present invention, but the correlation value inwhich the correlation value is normalized does not necessarily need tobe used. In other words, determination may be made based on the value ofthe term of the numerator excluding the term of the denominator in themathematical equation shown in equation (1).

The configuration of acquiring the color image from the imaging section2 has been described in the description for the embodiment of thepresent invention, but the configuration is not limited thereto. Forexample, the color image stored in advance in the main storage part 8,the auxiliary storage part 5, the recording medium 12 and the like maybe acquired and similar process may be performed.

The configuration of using the RGB information made up of “red”,“green”, and “blue” based on the three primary colors of light as thecolor information has been described in the description on theembodiment of the present invention, but the configuration is notlimited thereto, and the CMY information made up of “cyan”, “magenta”,and “yellow” which are complementary colors of the three primary colorsof light may be used. Furthermore, application is similarly possibleusing the three color variants of “hue”, “value”, and “chroma” based onthe attributes of the color. In this case, the first and second dataarrays may be configured using the information made up of the hue andchroma, other than the value. By excluding the value, the correlationprocess excluding the influence of the variation in brightness of theinput image and the difference in brightness from the model imagebecomes possible.

Two color variables may be used for the first and second data arraysinstead of using all three color variables.

In the description for the embodiment of the present invention describedabove, a plurality of predetermined color variables out of the threecolor variables defining each pixel contained in the determinationtarget region having the size same as the model image is transformed tothe first data array, and a plurality of predetermined color variablesout of the three color variables defining each pixel of the model imageis transformed to the second data array, and thereafter, the correlationvalue of the data arrays is calculated, but in place thereof, thepredetermined color variables of the pixel of the determination targetregion may be read so as to configure the first data array and appliedto one of the data arrays in the normalized correlation (apply to X(n,m) in equation (1), X(l) in equation (4)), and the predetermined colorvariables of the pixel of the model image may be read so as to configurethe second data array and applied to the other data array in thenormalized correlation (apply to Y(n, m) in equation (1), Y(1) inequation (4)), without generating the first data array and the seconddata array in the intermediate process.

According to the embodiment of the present invention, the RGBinformation defining each pixel contained in the determination targetregion is transformed to a single first data array, and the normalizedcorrelation value with the single second data array transformed from theRGB information defining each pixel contained in the model imageaccording to the same rule is calculated. Thus, an absolute comparisonis performed for all the RGB information contained in the determinationtarget region in place of the relative comparison as in the method usingcolor difference. Therefore, the specification of the region thatmatches the model image is achieved at high precision irrespective ofthe relative relationship of the color distribution in the determinationtarget region.

According to the embodiment of the present invention, the range of thecorrelation value is a value between 0 and 1 irrespective of the type ofdetermination target region since the normalized correlation value isused, and the influence of the variation in brightness of the inputimage and the difference in brightness from the model image iseliminated. Thus, the determination on matching is realized based onwhether or not the correlation value exceeds a threshold value set inadvance since the extent of matching of the determination target regionis compared at the same reference.

The embodiments disclosed herein are merely illustrative and should notbe construed as exclusive. The scope of the present invention is asdescribed in the Claims and not in the above description, andencompasses all modifications equivalent to the Claims and within thescope of the Claims.

1. An image processing device for specifying a region in an input imagebased on a correlation value with a model image; the image processingdevice comprising: an input image acquiring device for acquiring theinput image made up of a plurality of pixels defined by three colorvariables in which each color is independent from each other; adetermination target region setting device for setting a determinationtarget region having a size equal to the model image acquired in advancewith the respect to an entire region or a partial region of the inputimage acquired in the input image acquiring device; a first data arraytransformation device for transforming the plurality of predeterminedcolor variables of the three color variables defining each pixelcontained in the determination target region set in the determinationtarget region setting device to a single first data array according to apredetermined rule; and a correlation value calculating device forcalculating the correlation value between the first data arraytransformed in the first data array transformation device, and a singlesecond data array transformed from the plurality of predetermined colorvariables out of the three color variables defining each pixelconfiguring the model image according to the predetermined rule.
 2. Theimage processing device according to claim 1, wherein the first andsecond data arrays are single data arrays transformed from the threecolor variables according the predetermined rule.
 3. The imageprocessing device according to claim 2, further comprising: a referenceimage acquiring device for acquiring a reference image for extractingthe model image; a model image acquiring device for extracting an imageof the region corresponding to a command from the outside from thereference image acquired in the reference image acquiring device, andacquiring the extracted image as the model image; and a second dataarray transformation device for transforming the three color variablesdefining each pixel configuring the model image acquired in the modelimage acquiring device to the second data array according to thepredetermined rule.
 4. The image processing device according to claim 2,wherein each of the first and second data arrays is a two-dimensionalarray made up of a plurality elements arranged in a matrix form inassociation with the position of the pixel; and each of the plurality ofelements contains a one-dimensional array of the three color variablesdefining the pixel associated with the element.
 5. The image processingdevice according to claim 2, wherein each of the first and second arraysincludes three two-dimensional arrays arranged in a matrix form with onecolor variable out of three color variables defining each pixelassociated with the position of the pixel with respect to each of thethree color variables; and the three two-dimensional arrays are arrangedin order along the same direction and configure a single data array. 6.The image processing device according to claim 2, wherein each of thefirst and second data arrays includes three one-dimensional arrays inwhich one color variable out of the three color variables defining eachpixel is continuously arranged with respect to each of the three colorvariables; and the three one-dimensional arrays are arranged in order inthe same direction and configure a single data array.
 7. The imageprocessing device according to claim 2, wherein the determination targetregion setting device sequentially moves the determination target regionin the region of the input image, and repeatedly executes the processesin the first data array transformation device and the correlation valuecalculating device for every movement of the determination targetregion; and the image processing device further comprises: a determiningdevice for specifying the determination target region having highcorrelation value with the model image based on a comparison between thecorrelation value calculated for every movement of the determinationtarget region and a predetermined threshold value, and outputting thetotal number of specified determination target region and/or eachposition of the specified determination target regions when the movementof the determination target region is completed in the determinationtarget region setting device.
 8. The image processing device accordingto claim 2, wherein the determination target region setting devicesequentially moves the determination target region in the region of theinput image, and repeatedly executes the processes in the first dataarray transformation device and the correlation value calculating devicefor every movement of the determination target region; and the imageprocessing device further comprises: a determining device for extractingthe predetermined number of correlation values in order from highestvalue out of the correlation values calculated for every movement of thedetermination target region and specifying the determination targetregion corresponding to the extracted correlation value when themovement of the determination target region is completed in thedetermination target region setting device, and outputting each positionof the specified determination target region.
 9. The image processingdevice according to claim 2, wherein the three color variables are grayvalues of red, green, and blue; and the correlation value calculatingdevice calculates a normalized correlation value as correlation value.10. The image processing device according to claim 1, wherein the threecolor variables are level values representing hue, value, chroma; andeach of the first and second data arrays is a single data arraytransformed from the level value of the hue and chroma without includingthe level value of brightness according to the predetermined rule. 11.An image processing method for specifying a region in an input imagebased on a correlation value with a model image; the image processingmethod comprising: an input image acquiring step for acquiring the inputimage made up of a plurality of pixels defined by three color variablesin which each color is independent from each other; a determinationtarget region setting step for setting a determination target regionhaving a size equal to the model image acquired in advance with therespect to an entire region or a partial region of the input imageacquired in the input image acquiring step; and a correlation valuecalculating step for calculating the correlation value between a firstdata array and a second data array, the plurality of predeterminedcolors of the three color variables defining each pixel contained in thedetermination target region set in the determination target regionsetting step being a single first data array according to apredetermined rule, and the plurality of predetermined color variablesout of the three color variables defining each pixel configuring themodel image being a single second data array according to thepredetermined rule.
 12. An image processing method for specifying aregion in an input image based on a correlation value with a modelimage; the image processing method comprising: an input image acquiringstep for acquiring the input image made up of a plurality of pixelsdefined by three color variables in which each color is independent fromeach other; a determination target region setting step for setting adetermination target region having a size equal to the model imageacquired in advance with the respect to an entire region or a partialregion of the input image acquired in the input image acquiring step; afirst data array transformation step for transforming the plurality ofpredetermined colors of the three color variables defining each pixelcontained in the determination target region set in the determinationtarget region setting step to a single first array according to apredetermined rule; and a correlation value calculating step forcalculating the correlation value between the first data arraytransformed in the first data array transformation step, and a singlesecond data array transformed from the plurality of predetermined colorvariables out of the three color variables defining each pixelconfiguring the model image according to the predetermined rule.
 13. Theimage processing method according to claim 12, wherein the first andsecond data arrays are single data arrays transformed from the threecolor variables according the predetermined rule.
 14. The imageprocessing method according to claim 13, further comprising: a referenceimage acquiring step for acquiring a reference image for extracting themodel image; a model image acquiring step for extracting an image of theregion corresponding to a command from the outside from the referenceimage acquired in the reference image acquiring step, and acquiring theextracted image as the model image; and a second data arraytransformation step for transforming the three color variables definingeach pixel configuring the model image acquired in the model imageacquiring step to the second data array according to the predeterminedrule.
 15. The image processing method according to claim 13, whereineach of the first and second data arrays is a two-dimensional array madeup of a plurality elements arranged in a matrix form in association withthe position of the pixel; and each of the plurality of elementscontains a one-dimensional array of the three color variables definingthe pixel associated with the element.
 16. The image processing methodaccording to claim 13, wherein each of the first and second arraysincludes three two-dimensional arrays arranged in a matrix form with onecolor variable out of three color variables defining each pixelassociated with the position of the pixel with respect to each of thethree color variables; and the three two-dimensional arrays are arrangedin order along the same direction and configure a single data array. 17.The image processing method according to claim 13, wherein each of thefirst and second data arrays includes three one-dimensional arrays inwhich one color variable out of the three color variables defining eachpixel is continuously arranged with respect to each of the three colorvariables; and the three one-dimensional arrays are arranged in order inthe same direction and configure a single data array.
 18. The imageprocessing method according to claim 13, wherein the determinationtarget region setting step sequentially moves the determination targetregion in the region of the input image, and repeatedly executes theprocesses in the first data array transformation step and thecorrelation value calculating step for every movement of thedetermination target region; and the image processing method furthercomprises: a determining step for specifying the determination targetregion having high correlation value with the model image based on acomparison between the correlation value calculated for every movementof the determination target region and a predetermined threshold value,and outputting each position of the specified determination targetregion when the movement of the determination target region is completedin the determination target region setting step.
 19. The imageprocessing method according to claim 13, wherein the determinationtarget region setting step sequentially moves the determination targetregion in the region of the input image, and repeatedly executes theprocesses in the first data array transformation step and thecorrelation value calculating step for every movement of thedetermination target region; and the image processing method furthercomprises: a determining step for extracting the predetermined number ofcorrelation values in order from highest value out of the correlationvalues calculated for every movement of the determination target regionand specifying the determination target region corresponding to theextracted correlation value when the movement of the determinationtarget region is completed in the determination target region settingstep, and outputting the total number of specified determination targetregion and/or each position of the specified determination targetregion.
 20. The image processing method according to claim 13, whereinthe three color variables are gray values of red, green, and blue; andthe correlation value calculating step calculates a normalizedcorrelation value as correlation value.
 21. The image processing methodaccording to claim 11, wherein the three color variables are levelvalues representing hue, value, chroma; and each of the first and seconddata arrays is a single data array transformed from the level value ofthe hue and chroma without including the level value of brightnessaccording to the predetermined rule.
 22. A program for specifying aregion in an input image based on a correlation value with a modelimage; the image processing program executed by a computer comprising:an input image acquiring step for acquiring the input image made up of aplurality of pixels defined by three color variables in which each coloris independent from each other; a determination target region settingstep for setting a determination target region having a size equal tothe model image acquired in advance with the respect to an entire regionor a partial region of the input image acquired in the input imageacquiring step; a first data array transformation step for transformingthe plurality of predetermined colors of the three color variablesdefining each pixel contained in the determination target region set inthe determination target region setting step to a single first arrayaccording to a predetermined rule; and a correlation value calculatingstep for calculating the correlation value between the first data arraytransformed in the first data array transformation step, and a singlesecond data array transformed from the plurality of predetermined colorvariables out of the three color variables defining each pixelconfiguring the model image according to the predetermined rule.
 23. Acomputer readable recording medium recorded with the program accordingto claim 22.